package com.reader.api.constants;

/**
 * redis key常量集合.
 *
 * @author liujianqing
 * @date 2018/10/25
 */
public class RedisKeyConstants {
    /**
     * 短信验证码存储
     *
     * @variable1 手机号.
     */
    public static final String MOBILE_CODE_KEY = "reader:mobile:{%s}";
    //短信验证码存储时间
    public static final int MOBILE_CODE_EXPIRE_TIME = 15 * 60;

    /**
     * 短信验证码1分钟之内是否已经发送过
     *
     * @variable1 手机号.
     */
    public static final String MOBILE_CODE_RECENT_SEND_KEY = "reader:mobile:flag:{%s}";
    //1分钟不能获取2次验证码
    public static final int MOBILE_CODE_RECENT_SEND_TIME = 60;

    /**
     * 短信验证码按ip统计.
     *
     * @variable1 ip.
     */
    public static final String MOBILE_CODE_IP_COUNT_KEY = "reader:mobile:ip:{%s}";
    //短信验证码按ip统计存储时间(只要尝试再次刷短信就马上封6小时)
    public static final int MOBILE_CODE_IP_COUNT_EXPIRE_TIME = 6 * 60 * 60;
    //短信验证码按ip统计上限100次
    public static final int MOBILE_CODE_IP_COUNT_MAX_VALUE = 100;

    /**
     * app端token存储KEY
     */
    public static final String TOKEN = "app:reader:token:%s";
    public static final long TOKEN_EXPIRES_TIME=60*24*60*60*1000;//过期时间: 天*小时*分钟*秒*毫秒
}
